<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <#include "/manage/common/head.html" />

</head>
<body>
<!--顶部导航-->
<#include "/manage/common/navbar.html" />
<!--主内容-->
<div class="page-content">
    <!--侧边菜单-->
    <#include "/manage/common/sidebar.html" />
    <!--正文内容-->
    <div class="content-wrapper">
        <div class="container-fluid">
            <div class="content">
                <div class="page-title">
                    <h3>参数信息</h3>
                </div>
                <div class="page-body">
                    <p class="alert alert-warning">
                        <i class="fa fa-info-circle"></i> 对参数配置做的任何操作，必须“刷新缓存”再有效！
                        <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
                    </p>
                    <form action="${request.contextPath}/manage/config/save" method="POST" class="form-horizontal" role="form">
                        <input name="configId" type="hidden" value="${config.configId}" />
                        <div class="form-group">
                            <label class="col-sm-2 control-label">参数名称(*)</label>
                            <div class="col-sm-10">
                                <input type="text" name="configName" class="form-control" value="${config.configName}" title="">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">参数值(*)</label>
                            <div class="col-sm-10">
                                <textarea name="configValue" class="form-control" rows="3" >${config.configValue}</textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">参数说明</label>
                            <div class="col-sm-10">
                                <textarea name="description" class="form-control" rows="3" >${config.description}</textarea>
                            </div>
                        </div>
                        <div class="form-action">
                            <button type="submit" class="btn btn-success">保存信息</button>
                            <div class="pull-right">
                                <button type="button" class="btn btn-default">取消</button>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="page-footer"></div>
            </div>
        </div>
    </div>
</div>
</body>
</html>
<script type="text/javascript">
    $(function(){

        $("form").bootstrapValidator({
            submitHandler: function(validator, form, submitButton){
                submitButton.prop("disabled");
                $.post(form.attr("action"), form.serialize(), function(data){
                    if (data.result == "success"){
                        swal("操作成功！", "", "success");
                    }
                    submitButton.removeProp("disabled");
                });
            },
            feedbackIcons: {
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            },
            fields: {
                configName: {
                    validators: {
                        notEmpty: {
                            message: "参数名称不能为空！"
                        }
                    }
                },
                configValue:{
                    validators: {
                        notEmpty: {
                            message: "参数值不能为空！"
                        }
                    }
                }
            }
        });
    });
</script>